/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.veterinarySystem.dao;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import mx.its.dsw2.veterinarySystem.modelo.Examen;
import mx.its.dsw2.veterinarySystem.modelo.Mascota;

/**
 *
 * @author 100101
 */
@Stateless
public class ExamenDao extends AbstractDao<Examen> implements ExamenDaoLocal {
    @PersistenceContext(unitName = "veterinarySystem-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public ExamenDao() {
        super(Examen.class);
    }

    @Override
    public List<Examen> findMascotByClave(String clave) {
        Query q=em.createNamedQuery("Examen.findExamenMascotaByClave");
        q.setParameter("idMascotaClave", clave);
        return q.getResultList();
    }
    
    
    
}
